home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness:…ecision-Making Strategies / Workplace Effectiveness: Decision-Making Strategies.iso / pc / Files / Review.dxr / 00005_Scoring.ls < prev    next >
Encoding:
Text File  |  1998-12-16  |  3.0 KB  |  94 lines

  1. global gReviewData, gMasterData
  2.  
  3. on scoreTheInput
  4.   set the score of gReviewData to 0
  5.   oneChoices()
  6.   manyChoices()
  7.   numberFills()
  8.   set the text of member "scorefield" to string(the score of gReviewData)
  9. end
  10.  
  11. on oneChoices
  12.   set vScore to 0
  13.   set vQuestions to [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25]
  14.   set vAnswers to [5, 1, 3, 4, 2, 2, 1, 4, 3, 2, 3, 2, 1, 2, 3, 5, 1, 4, 2, 1, 1, 2, 2]
  15.   repeat with xAnswer in vQuestions
  16.     set vCorrect to getAt(vAnswers, getPos(vQuestions, xAnswer))
  17.     if vCorrect = getAt(the userdata of gReviewData, xAnswer) then
  18.       set vScore to vScore + 1
  19.     end if
  20.   end repeat
  21.   set vScore to vScore * 4
  22.   set the score of gReviewData to the score of gReviewData + vScore
  23. end
  24.  
  25. on manyChoices
  26.   set vScore to 0
  27.   set vQuestions to [17]
  28.   set vAnswers to [[2, 3, 2, 2]]
  29.   repeat with X = 1 to count(vQuestions)
  30.     set vCorrect to getAt(vAnswers, X)
  31.     set vUserChoice to getAt(the userdata of gReviewData, getAt(vQuestions, X))
  32.     if vCorrect = vUserChoice then
  33.       set vScore to vScore + 1
  34.     end if
  35.   end repeat
  36.   set vScore to vScore * 4
  37.   set the score of gReviewData to the score of gReviewData + vScore
  38. end
  39.  
  40. on numberFills
  41.   set vScore to 0
  42.   set vFields to ["qfield1", "qfield2", "qfield3", "qfield4", "qfield5", "qfield6"]
  43.   set vAnswers to ["5", "3", "6", "1", "2", "4"]
  44.   repeat with X = 1 to count(vFields)
  45.     if the text of member getAt(vFields, X) of castLib "Internal" = getAt(vAnswers, X) then
  46.       set vScore to vScore + 0.16669999999999999
  47.     end if
  48.   end repeat
  49.   set vScore to vScore * 4
  50.   set the score of gReviewData to the score of gReviewData + integer(vScore)
  51. end
  52.  
  53. on showScore
  54.   set vArtSprite to 7
  55.   set vScore to the score of gReviewData
  56.   case 1 of
  57.     (vScore >= 80):
  58.       set the member of sprite vArtSprite to member "great"
  59.       goNarrator(gMasterData, "190")
  60.     ((vScore >= 50) and (vScore < 80)):
  61.       set the member of sprite vArtSprite to member "good"
  62.       goNarrator(gMasterData, "191")
  63.     (vScore < 50):
  64.       set the member of sprite vArtSprite to member "OK"
  65.       goNarrator(gMasterData, "192")
  66.   end case
  67.   set the loc of sprite vArtSprite to point(320, 240)
  68. end
  69.  
  70. on crowdResponse
  71.   set vQuestion to the spin of gReviewData
  72.   if vQuestion = 1 then
  73.     firstOneSpecial()
  74.   end if
  75.   set vCurrentChoice to getAt(the userdata of gReviewData, vQuestion)
  76.   set vRealAnswers to [["5", "3", "6", "1", "2", "4"], 5, 1, 3, 4, 2, 2, 1, 4, 3, 2, 3, 2, 1, 2, 3, [2, 3, 2, 2], 5, 1, 4, 2, 1, 1, 2, 2]
  77.   set vCorrectChoice to getAt(vRealAnswers, vQuestion)
  78.   if vCurrentChoice = vCorrectChoice then
  79.     puppetSound("aaahh")
  80.     puppetSound(2, "applause short")
  81.   else
  82.     puppetSound("wrong")
  83.   end if
  84. end
  85.  
  86. on firstOneSpecial
  87.   set vFields to ["qfield1", "qfield2", "qfield3", "qfield4", "qfield5", "qfield6"]
  88.   set vAnswers to ["5", "3", "6", "1", "2", "4"]
  89.   repeat with X = 1 to count(vFields)
  90.     set vUserNumber to the text of member getAt(vFields, X)
  91.     setAt(getAt(the userdata of gReviewData, 1), X, vUserNumber)
  92.   end repeat
  93. end
  94.